package samsung.sds.business.vdiManagementSystem.systemManagement.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import samsung.sds.business.vdiManagementSystem.systemManagement.dao.SystemInfoMapper;
import samsung.sds.business.vdiManagementSystem.systemManagement.model.SystemInfoEntity;
import samsung.sds.business.vdiManagementSystem.systemManagement.service.SystemInfoService;
import samsung.sds.system.common.baseQuery.AbstractBaseService;
import samsung.sds.system.common.baseQuery.BaseMapper;
import samsung.sds.system.common.baseQuery.model.PageData;
import samsung.sds.system.common.model.QueryParam;

@Service
public class SystemInfoServiceImpl extends
		AbstractBaseService<SystemInfoEntity> implements
		SystemInfoService {
	@Autowired
	private SystemInfoMapper systemInfoMapper;

	@Override
	protected BaseMapper<SystemInfoEntity> getMapper() {

		return systemInfoMapper;
	}

	@Override
	public PageData<SystemInfoEntity> queryVdiSysInfoDataByName(
			QueryParam param) {
		return systemInfoMapper.queryVdiSysInfoDataByNameListPage(param);
	}

	
	@Override
	public PageData<SystemInfoEntity> queryAllVdiSysInfoByUser(QueryParam param){
		List<SystemInfoEntity> queryList = systemInfoMapper.queryListPage(param);
		PageData<SystemInfoEntity> pageData=new PageData<SystemInfoEntity>();
		pageData.setQueryResult(queryList);
		pageData.setQueryParam(param);
		return pageData;
	}

	@Override
	public List<String> queryAllLeader() {
		
		return systemInfoMapper.queryAllLeader();
	}

	@Override
	public boolean isUsed(String systemId){
		int c = systemInfoMapper.isUsed(systemId);
		if(c > 0){
			return true;
		}
		return false;
	}
	
	public int updateSystemInfo(List<String> ids){
		return systemInfoMapper.updateSystemInfo(ids);
	}
}
